<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/Software_Parser/wav_parser.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_1f0f7ecfcd3eb0933dd9ad093070e0ed.html">Software_Parser</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">wav_parser.c</div></div>
</div><!--header-->
<div class="contents">
<a href="wav__parser_8c.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &quot;<a class="code" href="wav__parser_8h.html">wav_parser.h</a>&quot;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="comment">//#define WAV_DEBUG_ENABLE /**&lt; 模块调试日志输出使能宏 */</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#ifdef WAV_DEBUG_ENABLE</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">    #define WAV_LOG(...)        printf(__VA_ARGS__)</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">   31</a></span><span class="preprocessor">    #define WAV_LOG(...)</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">   35</a></span><a class="code hl_struct" href="struct_w_a_v___i_n_f_o.html">WAV_INFO</a> <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="wav__parser_8c.html#acc10199929987de81dc6d395c39832c0">   45</a></span>int32_t <a class="code hl_function" href="wav__parser_8c.html#acc10199929987de81dc6d395c39832c0">wav_init</a>(uint8_t *buf, uint32_t len)</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>{</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    uint32_t br = 0;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>    uint8_t res = 0;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    <a class="code hl_struct" href="struct_chunk_r_i_f_f.html">ChunkRIFF</a> *riff;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    <a class="code hl_struct" href="struct_chunk_f_m_t.html">ChunkFMT</a> *fmt;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    <a class="code hl_struct" href="struct_chunk_f_a_c_t.html">ChunkFACT</a> *fact;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    <a class="code hl_struct" href="struct_chunk_d_a_t_a.html">ChunkDATA</a> *data;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>    riff = (<a class="code hl_struct" href="struct_chunk_r_i_f_f.html">ChunkRIFF</a> *)buf;        <span class="comment">/* 获取RIFF块 */</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    <span class="keywordflow">if</span> (riff-&gt;<a class="code hl_variable" href="struct_chunk_r_i_f_f.html#a5a589fb3f86750716fbc80ade5e232ef">Format</a> == 0X45564157) <span class="comment">/* 是WAV文件 */</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>        fmt = (<a class="code hl_struct" href="struct_chunk_f_m_t.html">ChunkFMT</a> *)(buf + 12);                        <span class="comment">/* 获取FMT块 */</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>        fact = (<a class="code hl_struct" href="struct_chunk_f_a_c_t.html">ChunkFACT</a> *)(buf + 12 + 8 + fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a87c23c12f9f531b128aefe10071a36c1">ChunkSize</a>); <span class="comment">/* 读取FACT块 */</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>        <span class="keywordflow">if</span> (fact-&gt;<a class="code hl_variable" href="struct_chunk_f_a_c_t.html#afdc824625f95881975cba3ea49675ff6">ChunkID</a> == 0X74636166 || fact-&gt;<a class="code hl_variable" href="struct_chunk_f_a_c_t.html#afdc824625f95881975cba3ea49675ff6">ChunkID</a> == 0X5453494C)</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>        {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a> = 12 + 8 + fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a87c23c12f9f531b128aefe10071a36c1">ChunkSize</a> + 8 + fact-&gt;<a class="code hl_variable" href="struct_chunk_f_a_c_t.html#a87c23c12f9f531b128aefe10071a36c1">ChunkSize</a>; <span class="comment">/* 具有fact/LIST块的时候(未测试) */</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>        }</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>        {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a> = 12 + 8 + fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a87c23c12f9f531b128aefe10071a36c1">ChunkSize</a>;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>        }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>        data = (<a class="code hl_struct" href="struct_chunk_d_a_t_a.html">ChunkDATA</a> *)(buf + <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a>); <span class="comment">/* 读取DATA块 */</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>        <span class="keywordflow">if</span> (data-&gt;<a class="code hl_variable" href="struct_chunk_d_a_t_a.html#afdc824625f95881975cba3ea49675ff6">ChunkID</a> == 0X61746164)            <span class="comment">/* 解析成功! */</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>        {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a261fa2bf32f81cfbe9618eef33f1fcff">audioformat</a> = fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#ab42b36987ea0001422241dfcb3d71469">AudioFormat</a>; <span class="comment">/* 音频格式 */</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a217de89eba97c241e226145538b73a6c">nchannels</a> = fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a8ef58422513cea91641e9905f6b91a0a">NumOfChannels</a>; <span class="comment">/* 通道数 */</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a370f2f23a5016862b7862b5e90f90842">samplerate</a> = fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a930ec675cfdc1a0f18f3414583f7b950">SampleRate</a>;   <span class="comment">/* 采样率 */</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a32678c62007e0748dae550bd1007a07d">bitrate</a> = fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a9ac6d1010b60ba506bf0081a26e867a3">ByteRate</a> * 8;    <span class="comment">/* 得到位速 */</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a664f4494c5d2183e1f5b32f6e39588da">blockalign</a> = fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#ab7344ede64a4dc451570438de23295f3">BlockAlign</a>;   <span class="comment">/* 块对齐 */</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a00ede19d29442e4c386d7bcc1f22a014">bps</a> = fmt-&gt;<a class="code hl_variable" href="struct_chunk_f_m_t.html#a9d34774dc01aa58a0b4152e6cd8b8c10">BitsPerSample</a>;       <span class="comment">/* 位数,16/24/32位 */</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a7e1a0ea769d8bcfeb3ac0cdc17a20810">datasize</a> = data-&gt;<a class="code hl_variable" href="struct_chunk_d_a_t_a.html#a87c23c12f9f531b128aefe10071a36c1">ChunkSize</a>;     <span class="comment">/* 数据块大小 */</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>            <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a> = <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a> + 8; <span class="comment">/* 数据流开始的地方. */</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span> </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;\r\n&quot;</span>);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;audioformat:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a261fa2bf32f81cfbe9618eef33f1fcff">audioformat</a>);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;nchannels:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a217de89eba97c241e226145538b73a6c">nchannels</a>);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;samplerate:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a370f2f23a5016862b7862b5e90f90842">samplerate</a>);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;bitrate:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a32678c62007e0748dae550bd1007a07d">bitrate</a>);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;blockalign:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a664f4494c5d2183e1f5b32f6e39588da">blockalign</a>);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;bps:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a00ede19d29442e4c386d7bcc1f22a014">bps</a>);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;datasize:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a7e1a0ea769d8bcfeb3ac0cdc17a20810">datasize</a>);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>            <a class="code hl_define" href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a>(<span class="stringliteral">&quot;Wavx-&gt;datastart:%d\r\n&quot;</span>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a>);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>        }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>        {</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>            res = -3; <span class="comment">/* data区域未找到. */</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>        }</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    }</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>    {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>        res = -2; <span class="comment">/* 非wav文件 */</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>    }</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>}</div>
<div class="ttc" id="astruct_chunk_d_a_t_a_html"><div class="ttname"><a href="struct_chunk_d_a_t_a.html">ChunkDATA</a></div><div class="ttdoc">data块</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00058">wav_parser.h:59</a></div></div>
<div class="ttc" id="astruct_chunk_d_a_t_a_html_a87c23c12f9f531b128aefe10071a36c1"><div class="ttname"><a href="struct_chunk_d_a_t_a.html#a87c23c12f9f531b128aefe10071a36c1">ChunkDATA::ChunkSize</a></div><div class="ttdeci">uint32_t ChunkSize</div><div class="ttdoc">子集合大小(不包括ID和Size)</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00061">wav_parser.h:61</a></div></div>
<div class="ttc" id="astruct_chunk_d_a_t_a_html_afdc824625f95881975cba3ea49675ff6"><div class="ttname"><a href="struct_chunk_d_a_t_a.html#afdc824625f95881975cba3ea49675ff6">ChunkDATA::ChunkID</a></div><div class="ttdeci">uint32_t ChunkID</div><div class="ttdoc">chunk id;这里固定为&quot;data&quot;,即0X5453494C</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00060">wav_parser.h:60</a></div></div>
<div class="ttc" id="astruct_chunk_f_a_c_t_html"><div class="ttname"><a href="struct_chunk_f_a_c_t.html">ChunkFACT</a></div><div class="ttdoc">fact块</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00050">wav_parser.h:51</a></div></div>
<div class="ttc" id="astruct_chunk_f_a_c_t_html_a87c23c12f9f531b128aefe10071a36c1"><div class="ttname"><a href="struct_chunk_f_a_c_t.html#a87c23c12f9f531b128aefe10071a36c1">ChunkFACT::ChunkSize</a></div><div class="ttdeci">uint32_t ChunkSize</div><div class="ttdoc">子集合大小(不包括ID和Size);这里为:4.</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00053">wav_parser.h:53</a></div></div>
<div class="ttc" id="astruct_chunk_f_a_c_t_html_afdc824625f95881975cba3ea49675ff6"><div class="ttname"><a href="struct_chunk_f_a_c_t.html#afdc824625f95881975cba3ea49675ff6">ChunkFACT::ChunkID</a></div><div class="ttdeci">uint32_t ChunkID</div><div class="ttdoc">chunk id;这里固定为&quot;fact&quot;,即0X74636166;</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00052">wav_parser.h:52</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html"><div class="ttname"><a href="struct_chunk_f_m_t.html">ChunkFMT</a></div><div class="ttdoc">fmt 块</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00035">wav_parser.h:36</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_a87c23c12f9f531b128aefe10071a36c1"><div class="ttname"><a href="struct_chunk_f_m_t.html#a87c23c12f9f531b128aefe10071a36c1">ChunkFMT::ChunkSize</a></div><div class="ttdeci">uint32_t ChunkSize</div><div class="ttdoc">子集合大小(不包括ID和Size);这里为:20.</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00038">wav_parser.h:38</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_a8ef58422513cea91641e9905f6b91a0a"><div class="ttname"><a href="struct_chunk_f_m_t.html#a8ef58422513cea91641e9905f6b91a0a">ChunkFMT::NumOfChannels</a></div><div class="ttdeci">uint16_t NumOfChannels</div><div class="ttdoc">通道数量;1,表示单声道;2,表示双声道;</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00040">wav_parser.h:40</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_a930ec675cfdc1a0f18f3414583f7b950"><div class="ttname"><a href="struct_chunk_f_m_t.html#a930ec675cfdc1a0f18f3414583f7b950">ChunkFMT::SampleRate</a></div><div class="ttdeci">uint32_t SampleRate</div><div class="ttdoc">采样率;0X1F40,表示8Khz</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00041">wav_parser.h:41</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_a9ac6d1010b60ba506bf0081a26e867a3"><div class="ttname"><a href="struct_chunk_f_m_t.html#a9ac6d1010b60ba506bf0081a26e867a3">ChunkFMT::ByteRate</a></div><div class="ttdeci">uint32_t ByteRate</div><div class="ttdoc">字节速率;</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00042">wav_parser.h:42</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_a9d34774dc01aa58a0b4152e6cd8b8c10"><div class="ttname"><a href="struct_chunk_f_m_t.html#a9d34774dc01aa58a0b4152e6cd8b8c10">ChunkFMT::BitsPerSample</a></div><div class="ttdeci">uint16_t BitsPerSample</div><div class="ttdoc">单个采样数据大小;4位ADPCM,设置为4</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00044">wav_parser.h:44</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_ab42b36987ea0001422241dfcb3d71469"><div class="ttname"><a href="struct_chunk_f_m_t.html#ab42b36987ea0001422241dfcb3d71469">ChunkFMT::AudioFormat</a></div><div class="ttdeci">uint16_t AudioFormat</div><div class="ttdoc">音频格式;0X01,表示线性PCM;0X11表示IMA ADPCM</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00039">wav_parser.h:39</a></div></div>
<div class="ttc" id="astruct_chunk_f_m_t_html_ab7344ede64a4dc451570438de23295f3"><div class="ttname"><a href="struct_chunk_f_m_t.html#ab7344ede64a4dc451570438de23295f3">ChunkFMT::BlockAlign</a></div><div class="ttdeci">uint16_t BlockAlign</div><div class="ttdoc">块对齐(字节);</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00043">wav_parser.h:43</a></div></div>
<div class="ttc" id="astruct_chunk_r_i_f_f_html"><div class="ttname"><a href="struct_chunk_r_i_f_f.html">ChunkRIFF</a></div><div class="ttdoc">RIFF块</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00027">wav_parser.h:28</a></div></div>
<div class="ttc" id="astruct_chunk_r_i_f_f_html_a5a589fb3f86750716fbc80ade5e232ef"><div class="ttname"><a href="struct_chunk_r_i_f_f.html#a5a589fb3f86750716fbc80ade5e232ef">ChunkRIFF::Format</a></div><div class="ttdeci">uint32_t Format</div><div class="ttdoc">格式;WAVE,即0X45564157</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00031">wav_parser.h:31</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html">WAV_INFO</a></div><div class="ttdoc">wav 播放控制结构体</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00076">wav_parser.h:77</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a00ede19d29442e4c386d7bcc1f22a014"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a00ede19d29442e4c386d7bcc1f22a014">WAV_INFO::bps</a></div><div class="ttdeci">uint16_t bps</div><div class="ttdoc">位数,比如16bit,24bit,32bit</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00088">wav_parser.h:88</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a217de89eba97c241e226145538b73a6c"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a217de89eba97c241e226145538b73a6c">WAV_INFO::nchannels</a></div><div class="ttdeci">uint16_t nchannels</div><div class="ttdoc">通道数量;1,表示单声道;2,表示双声道;</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00079">wav_parser.h:79</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a261fa2bf32f81cfbe9618eef33f1fcff"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a261fa2bf32f81cfbe9618eef33f1fcff">WAV_INFO::audioformat</a></div><div class="ttdeci">uint16_t audioformat</div><div class="ttdoc">音频格式;0X01,表示线性PCM;0X11表示IMA ADPCM</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00078">wav_parser.h:78</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a32678c62007e0748dae550bd1007a07d"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a32678c62007e0748dae550bd1007a07d">WAV_INFO::bitrate</a></div><div class="ttdeci">uint32_t bitrate</div><div class="ttdoc">比特率(位速)</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00086">wav_parser.h:86</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a370f2f23a5016862b7862b5e90f90842"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a370f2f23a5016862b7862b5e90f90842">WAV_INFO::samplerate</a></div><div class="ttdeci">uint32_t samplerate</div><div class="ttdoc">采样率</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00087">wav_parser.h:87</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a664f4494c5d2183e1f5b32f6e39588da"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a664f4494c5d2183e1f5b32f6e39588da">WAV_INFO::blockalign</a></div><div class="ttdeci">uint16_t blockalign</div><div class="ttdoc">块对齐(字节);</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00080">wav_parser.h:80</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a7e1a0ea769d8bcfeb3ac0cdc17a20810"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a7e1a0ea769d8bcfeb3ac0cdc17a20810">WAV_INFO::datasize</a></div><div class="ttdeci">uint32_t datasize</div><div class="ttdoc">WAV数据大小</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00081">wav_parser.h:81</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_ad724f0361ba01c7bfb66c62592612538"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">WAV_INFO::datastart</a></div><div class="ttdeci">uint32_t datastart</div><div class="ttdoc">数据帧开始的位置(在文件里面的偏移)</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00090">wav_parser.h:90</a></div></div>
<div class="ttc" id="awav__parser_8c_html_a99bd943f7fb6a92604438705eb26b946"><div class="ttname"><a href="wav__parser_8c.html#a99bd943f7fb6a92604438705eb26b946">WAV_LOG</a></div><div class="ttdeci">#define WAV_LOG(...)</div><div class="ttdoc">模块调试日志打印宏</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8c_source.html#l00031">wav_parser.c:31</a></div></div>
<div class="ttc" id="awav__parser_8c_html_aac71309979edec17487770ba9f4650a6"><div class="ttname"><a href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a></div><div class="ttdeci">WAV_INFO Wavx</div><div class="ttdoc">WAV 音频流信息</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8c_source.html#l00035">wav_parser.c:35</a></div></div>
<div class="ttc" id="awav__parser_8c_html_acc10199929987de81dc6d395c39832c0"><div class="ttname"><a href="wav__parser_8c.html#acc10199929987de81dc6d395c39832c0">wav_init</a></div><div class="ttdeci">int32_t wav_init(uint8_t *buf, uint32_t len)</div><div class="ttdoc">wav 音频解析</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8c_source.html#l00045">wav_parser.c:45</a></div></div>
<div class="ttc" id="awav__parser_8h_html"><div class="ttname"><a href="wav__parser_8h.html">wav_parser.h</a></div><div class="ttdoc">wav 音频格式解析</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
